package com.dsy.xiangcun_index.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsy.tools.common.utils.QueryObj;
import com.dsy.tools.entity.TbCulture;
import com.dsy.xiangcun_index.mapper.TbCultureMapper;
import com.dsy.xiangcun_index.service.ITbCultureService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author dsy
 * @since 2021-03-10
 */
@Service
public class TbCultureServiceImpl extends ServiceImpl<TbCultureMapper, TbCulture> implements ITbCultureService {
    @Autowired
    private TbCultureMapper cultureMapper;

    @Override
    public IPage<TbCulture> getAllCulture(long page, long limit, QueryWrapper<QueryObj> wrapper) {
        return cultureMapper.getAllCulture(new Page<>(page,limit),wrapper);
    }

    @Override
    public TbCulture getCultureById(Integer cultureId) {
        return cultureMapper.getCultureById(cultureId);
    }

    @Override
    public List<TbCulture> getIndexCultureList() {
        return cultureMapper.getIndexCultureList();
    }
}
